#include<iostream>
#include<string>
using namespace std;

int main(){
    string s1,s2;
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>s1>>s2;
        if(s1==s2) cout<<"Tie"<<endl;
        else if(s1=="Scissors" && s2=="Paper") cout<<"Player1"<<endl;
        else if(s2=="Scissors" && s1=="Paper") cout<<"Player2"<<endl;
        else if(s1>s2) cout<<"Player2"<<endl;
        else if(s1<s2) cout<<"Player1"<<endl;
    }


    return 0;
}
